<template>
  <div class="login-container">
    <el-form class="login-form" :model="loginForm" ref="loginForm">
      <div class="title-container">
        <h3>rs-spa-starter-vue</h3>
      </div>
      <el-form-item>
        <el-input type="text" v-model="loginForm.account" placeholder="用户名"></el-input>
      </el-form-item>
      <el-form-item>
        <el-input type="password" v-model="loginForm.password" placeholder="密码"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" style="width: 100%;" @click.native.prevent="handleLogin">登陆</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'login',
  data () {
    return {
      loginForm: {
        account: 'admin',
        password: '123456'
      }
    }
  },
  methods: {
    handleLogin () {
      this.$router.push({name: 'home'})
    }
  }
}
</script>

<style scoped>
  .login-container {
    position: relative;
    background-color: #f9f9f9;
    height: 100vh;

    & .login-form {
      position: absolute;
      left: 50%;
      top: 50%;
      margin-left: -164px;
      margin-top: -105px;
      width: 328px;
      height: 210px;
    }
  }
</style>
